package top.younote.cherry.email;

import org.springframework.util.CollectionUtils;

import java.util.Map;

/**
 * @Description:
 * @Author: duanluyao
 * @CreateTime: 2021/10/14 17:33:02
 */
public class DailyCalendarAndWeather {

    public static String dailyCalenderAndWeather() {
        StringBuilder builder = new StringBuilder();
        builder.append("<html><body>");
        builder.append("<b>今天天气：</b>");
        builder.append("<img src=\'cid:001\'/>");
        builder.append("<b>本月日历：</b>");
        builder.append("<img src=\'cid:002\'/>");
        builder.append("</body></html>");
        return builder.toString();
    }

    public static String dailyNews(Map<String, String> listNews) {
        if(CollectionUtils.isEmpty(listNews)){
            return null;
        }
        StringBuilder builder = new StringBuilder();
        builder.append("<html><body>");
        for (String key : listNews.keySet()) {
            builder.append("<b>");
            builder.append(key);
            builder.append("</b>");
            builder.append("</br>");
            builder.append(listNews.get(key));
            builder.append("</br>");
        }
        builder.append("</html></body>");
        return builder.toString();
    }
}
